{__NOLAYOUT__}

<toolbar id="btn_toolbar" class="toolbar" data-module="/admin/menu">
<div class="btn-group">
        <button type="button" data-name="addButton" class="btn btn-default" data-event-type="view" data-event-value="" data-target="modal"><i class="fa fa-plus" aria-hidden="true"> </i>添加</button>
        <button type="button" data-name="editButton" class="btn btn-default" data-event-type="view" data-event-value="" data-target="modal"><i class="fa fa-edit" aria-hidden="true"> </i>编辑</button>
        <!-- <button type="button" data-name="deleteButton" class="btn btn-default" data-event-type="default" data-event-value="" data-target="default"><i class="fa fa-trash" aria-hidden="true"> </i>删除</button> -->
    </div>
</toolbar>

<table id="btn_gridview" data-toggle="gridview" data-height="350" class="table table-hover" data-pagination="false" data-toolbar="#btn_toolbar" data-method="post" data-url="/admin/menu/toolbar?menu={$menu_id}"  data-page-size="5" data-page-list="[5, 25, 50, All]" data-unique-id="id"  >
	<thead>
		<tr>
			<th data-width="40" data-align="center" data-checkbox="true"></th>
			<th data-width="50" data-field="sort" data-formatter="format_sort">排序</th>
			<th data-field="title">按钮名称</th>
			<th data-field="name">按钮标识</th>
			<th data-field="visible" data-formatter="fomat_visible">是否显示</th>
			<th data-field="access" data-formatter="fomat_access">权限</th>
			<th data-field="event_type">事件类型</th>
			<th data-field="event_value">事件值</th>
			<th data-field="target">执行方式</th>
			<th data-field="icon" data-formatter="fomat_icon" data-align="center">图标</th>
			<th data-field="group" data-align="center">分组</th>
			<th data-field="remark">说明</th>
		</tr>
	</thead>
</table>

<script type="text/javascript">

	$(function(){
		$("#btn_gridview").on('addButton',function(e, gridview, params){

			var menu_id = $(this).data('data-menu');
			if(menu_id == null ){
				return alertMsg('请先勾选要编辑的菜单！');
			}
			params.data.menu_id = menu_id
		}) 
	})
</script>